package com.common.client;

public class ToolbarAndMenuItems {

	private String name;
	private String caption;
	private String imgUrl;
	private boolean disabled;
	private ObjectOnHandler onEventHendler;

	public static final String ACTION_ADD = "add";
	public static final String ACTION_EDIT = "edit";
	public static final String ACTION_DELETE = "delete";

	public static final String ICON_ADD = "demoApp/icon_add.png";
	public static final String ICON_EDIT = "demoApp/icon_edit.png";
	public static final String ICON_DELETE = "demoApp/icon_delete.png";

	public static final String CAPTION_ADD = "დამატება";
	public static final String CAPTION_EDIT = "შეცვლა";
	public static final String CAPTION_DELETE = "წაშლა";

	public static ToolbarAndMenuItems createAddItem(
			ObjectOnHandler onEventHendler) {
		return new ToolbarAndMenuItems(ACTION_ADD, CAPTION_ADD, ICON_ADD,
				false, onEventHendler);
	}

	public static ToolbarAndMenuItems createEditItem(
			ObjectOnHandler onEventHendler) {
		return new ToolbarAndMenuItems(ACTION_EDIT, CAPTION_EDIT, ICON_EDIT,
				true, onEventHendler);
	}

	public static ToolbarAndMenuItems createDeteteItem(
			ObjectOnHandler onEventHendler) {
		return new ToolbarAndMenuItems(ACTION_DELETE, CAPTION_DELETE,
				ICON_DELETE, true, onEventHendler);
	}

	public ToolbarAndMenuItems(String name, String caption, String imgUrl,
			boolean disabled, ObjectOnHandler onEventHendler) {
		this.setCaption(caption);
		this.setDisabled(disabled);
		this.setImgUrl(imgUrl);
		this.setName(name);
		this.setOnEventHendler(onEventHendler);

	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCaption() {
		return caption;
	}

	public void setCaption(String caption) {
		this.caption = caption;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public ObjectOnHandler getOnEventHendler() {
		return onEventHendler;
	}

	public void setOnEventHendler(ObjectOnHandler onEventHendler) {
		this.onEventHendler = onEventHendler;
	}

}
